#ifndef INSTALLAPPWIDGET_H
#define INSTALLAPPWIDGET_H

#include <QWidget>
#include <QPushButton>
#include <QLabel>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QFrame>
#include <QFileDialog>

#include <QDebug>
#include <QDropEvent>
#include <QDragEnterEvent>
#include <QMimeData>
#include <QUrl>
#include <QList>

#include <QProcess>
#include <QMessageBox>

#include "installapkthread.h"
#include "installwaitdialog.h"


class InstallAppWidget : public QWidget
{
    Q_OBJECT
public:
    explicit InstallAppWidget(QWidget *parent = nullptr);


private:
    QLabel *ddropLabel;
    QPushButton *selectBtn;
    QPushButton *installBtn;
    QVBoxLayout *mainLayout;
    QHBoxLayout *btnLayout;

    QProcess *process;

    InstallAPKThread *thread;
    InstallWaitDialog *dialog;

    QString filePath = nullptr;
    QString installMessage;

    void dragEnterEvent(QDragEnterEvent*event) Q_DECL_OVERRIDE;
//    void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE;
    void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;

private slots:
    void showFile();
    void installAPK();
    void receiveMessageFromThread(QString);
    void threadFinsih();

signals:
    void sendFilePathToThread(QString);

};

#endif // INSTALLAPPWIDGET_H
